package array

type Stack interface {
	GetSize () int
	IsEmpty () bool
	Push (v interface{})
	Pop () interface{}
	Peek () interface{}
}

func NewFlStack(options ...FunctionOption) Stack {
	return &FLArrayStack{
		fl: New(options...),
	}
}

type FLArrayStack struct {
	fl *FlArray
}

func (f *FLArrayStack) GetSize() int {
	return f.fl.size
}

func (f *FLArrayStack) IsEmpty() bool {
	return f.fl.IsEmpty()
}

func (f *FLArrayStack) Push(v interface{}) {
	f.fl.AddLast(v)
}

func (f *FLArrayStack) Pop()interface{} {
	return f.fl.DeleteLast()
}

func (f *FLArrayStack) Peek()interface{} {
	return f.fl.FindLast()
}